<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="#{facesContext.externalContext.requestContextPath}#{ConfiguracionBean.rutaContexto}resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="#{facesContext.externalContext.requestContextPath}#{ConfiguracionBean.rutaContexto}resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <link rel="icon" href="#{facesContext.externalContext.requestContextPath}#{ConfiguracionBean.rutaContexto}resources/images/favicon.ico"/>
        <title>Mapa Recursos ID</title>
        
        <h:panelGroup rendered="#{ConfiguracionBean.googleAnalytics}">
            <script type="text/javascript">
                var _gaq = _gaq || [];
                _gaq.push(['_setAccount', 'UA-35893915-1']);
                _gaq.push(['_trackPageview']);

                (function() {
                    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                })();
            </script>
        </h:panelGroup>

    </h:head>

    <h:body>
        <!-- Header -->
        <div id="top">
            <ui:include src="header.xhtml"/>
            <ui:include src="menu.xhtml"/>
        </div>
        <h:panelGroup id="pagina">
        <!-- Barra título -->
        <div id="titulo">
            <div style="float: right;">

                <h:panelGroup rendered="#{!UserBean.login}">
                    <h:panelGrid cellpadding="0" cellspacing="0">
                        <h:panelGrid columns="2" cellpadding="0" cellspacing="0">
                            <h:outputLink value="#{inicioBean.code}">     
                                <p:graphicImage value="#{ConfiguracionBean.rutaContexto}resources/images/login.png" style="border:0px"/>
                            </h:outputLink>
                        </h:panelGrid>
                    </h:panelGrid>
                </h:panelGroup>

                <p:dialog modal="true" widgetVar="statusDialog" header="Procesando" draggable="false" closable="false" resizable="false">
                    <h:panelGrid style="text-align: center; margin: 0px auto;" cellspacing="0" cellpadding="0">
                        <h:panelGrid width="100%">
                            <p:graphicImage value="#{ConfiguracionBean.rutaContexto}resources/images/ajaxloadingbar.gif" />
                        </h:panelGrid>
                    </h:panelGrid>
                </p:dialog>
                <p:ajaxStatus onstart="statusDialog.show();" oncomplete="statusDialog.hide();"/>
                
                <h:panelGroup rendered="#{UserBean.login}">
                    <h:panelGrid cellpadding="0" cellspacing="0">
                        <h:form id="cerrar">
                            <h:commandLink action="#{inicioBean.cerrarSesion}" >
                                <p:graphicImage value="#{ConfiguracionBean.rutaContexto}resources/images/logout.png" style="border:0px"/>
                            </h:commandLink>
                        </h:form>
                    </h:panelGrid>
                </h:panelGroup>
            </div>
            <div><ui:insert name="titulo">Titulo</ui:insert></div>
        </div>
        <!-- Centro -->
        <div id="container">
            <!-- Derecha -->
            <div id="right" >
                <h:panelGroup id="pgMenuTramite" rendered="#{UserBean.login}">
                    <ui:include src="#{ConfiguracionBean.rutaContexto}usuarios/menuDerecha.xhtml"/>
                </h:panelGroup>
            </div>
            <!-- Contenido -->
            <div id="content" class="right_content" >       
                <h:panelGrid width="100%">
                    <ui:insert name="content">Content</ui:insert>
                </h:panelGrid>
            </div>
        </div>
        </h:panelGroup>
        <!-- Bottom -->
        <div id="bottom" align="center">
            <ui:include src="footer.xhtml"/>
        </div>
    </h:body>

</html>
